The present invention relates to the field of computer graphics. Many computer graphic images are created by mathematically modeling the interaction of light with a three dimensional scene from a given viewpoint. This process, called rendering, generates a two-dimensional image of the scene from the given viewpoint, and is analogous to taking a photograph of a real-world scene. There are many different types of rendering techniques, each with their advantages and disadvantages. Among these rendering techniques are ray tracing and rasterization.
Rasterization typically transforms the geometry of a three-dimensional scene into a coordinate system associated with a specific viewpoint and applies scan conversion to the transformed geometry to create sets of pixels forming all or part of a rendered image. Rasterization techniques typically apply clipping algorithms to determine a subset of the geometry of a scene that are potentially visible from the viewpoint. Then, rasterization techniques scan convert each of the set of potentially visible geometry in a scene to create a rendered image. The computational cost of rasterization techniques depends primarily on the geometric complexity of the scene, such as the number of potentially visible geometric primitives, rather than the number of pixels covered by the scene geometry. For this reason, rasterization techniques are generally used for real-time rendering, as they can render a large number of pixels with minimal additional computational cost. By limiting the geometric complexity of scenes, rasterization can render high-resolution images at frame rates suitable for interactive applications.
Ray tracing typically follows the path of a ray of light through a three dimensional scene to calculate attributes such as the absorption, reflection, and/or refraction of the ray. Typically, ray tracing calculates the attributes of at least one ray for each pixel in the rendered image. However, the computation time for each ray is somewhat independent of the geometric complexity of the three dimensional scene. As a result, the computational cost of ray tracing depends primarily on the number of pixels to be rendered, rather than the complexity of the scene. At typical image resolutions, the computational cost of rendering images using ray tracing is typically much greater than that from rasterization, making real-time ray tracing difficult or impossible with currently available graphics hardware and software.
There is strong demand for improved visual quality and fidelity in real-time computer graphics. To meet this demand, application developers are creating content that includes a larger number of geometric primitives. The increased number of geometric primitives are typically used to represent objects with finer levels of detail. Thus, as geometric complexity of a scene increases, the average size of geometric primitives typically decreases. For example, a character model may have a large number of small (often sub-pixel size) triangles representing each strand of its hair. Unfortunately, rasterization is often inefficient for rendering a large number of geometric primitives, especially when the geometric primitives cover a relatively small number of pixels. In these cases, rendering techniques, such as ray tracing, are often more efficient.
It is therefore desirable for a system and method to efficiently render a large number of geometric primitives by selecting the most appropriate rendering techniques for different portions of the scene to be rendered. It is further desirable that the system and method be capable of dynamically selecting the most appropriate rendering technique for geometric primitives based upon the viewpoint used for rendering and other parameters. It is also desirable for the system and method to incur minimal processing overhead in determining the most appropriate rendering technique to apply to one or more primitives. Additionally, it is desirable to be able to implement all or portions of the system and method in software and/or in dedicated hardware.